package model.command;

import model.Command;
import model.Reference;
import controller.RuntimeState;

public class Store extends Command {

	private static final long serialVersionUID = -5954586653387954157L;

	@Override
	public int getParameterCount() {
		return 1;
	}

	@Override
	public String getCommandName() {
		return "STORE";
	}

	@Override
	public void run(RuntimeState runtimeState, Reference... refs) {
		int value = runtimeState.getAccumulator();
		runtimeState.setRegisterValueAt(refs[0].getAddress(), value);
	}

}
